﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>{$config.sitename}</title>

    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <meta charset="utf-8">
    <link href="/templatesstore/css/cate190.css" rel="stylesheet" type="text/css" />
    <link href="/templatesstore/css/iscroll.css" rel="stylesheet" type="text/css" />
    <style>
 
 
</style>
     <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js" type="text/javascript"></script>
    <script src="/templatesstore/js/iscroll.js" type="text/javascript"></script>
    <script type="text/javascript">
        var myScroll;

        function loaded() {
            myScroll = new iScroll('wrapper', {
                snap: true,
                momentum: false,
                hScrollbar: false,
                onScrollEnd: function () {
                    document.querySelector('#indicator > li.active').className = '';
                    document.querySelector('#indicator > li:nth-child(' + (this.currPageX + 1) + ')').className = 'active';
                }
            });

        }

        document.addEventListener('DOMContentLoaded', loaded, false);
    </script>

</head>
<body>
    <!--music-->
    <style>
        .btn_music {
            display: inline-block;
            width: 35px;
            height: 35px;
            background: url('/templatesstore/images/play.png') no-repeat center center;
            background-size: 100% auto;
            position: absolute;
            z-index: 100;
            left: 15px;
            top: 20px;
        }

            .btn_music.on {
                background-image: url("/templatesstore/images/stop.png");
            }
    </style>
   
    <script>

        var playbox = (function () {
            //author:eric_wu
            var _playbox = function () {
                var that = this;
                that.box = null;
                that.player = null;
                that.src = null;
                that.on = false;
                //
                that.autoPlayFix = {
                    on: true,
                    //evtName: ("ontouchstart" in window)?"touchend":"click"
                    evtName: ("ontouchstart" in window) ? "touchstart" : "mouseover"

                }

            }
            _playbox.prototype = {
                init: function (box_ele) {
                    this.box = "string" === typeof (box_ele) ? document.getElementById(box_ele) : box_ele;
                    this.player = this.box.querySelectorAll("audio")[0];
                    this.src = this.player.src;
                    this.init = function () { return this; }
                    this.autoPlayEvt(true);
                    return this;
                },
                play: function () {
                    if (this.autoPlayFix.on) {
                        this.autoPlayFix.on = false;
                        this.autoPlayEvt(false);
                    }
                    this.on = !this.on;
                    if (true == this.on) {
                        this.player.src = this.src;
                        this.player.play();
                    } else {
                        this.player.pause();
                        this.player.src = null;
                    }
                    if ("function" == typeof (this.play_fn)) {
                        this.play_fn.call(this);
                    }
                },
                handleEvent: function (evt) {
                    this.play();
                },
                autoPlayEvt: function (important) {
                    if (important || this.autoPlayFix.on) {
                        document.body.addEventListener(this.autoPlayFix.evtName, this, false);
                    } else {
                        document.body.removeEventListener(this.autoPlayFix.evtName, this, false);
                    }
                }
            }
            //
            return new _playbox();
        })();

        playbox.play_fn = function () {
            this.box.className = this.on ? "btn_music on" : "btn_music";
        }
    </script>

    <script type="text/javascript">
        $(document).ready(function () {
            playbox.init("playbox");
            /*
            setTimeout(function() {
                // IE
                if(document.all) {
                    document.getElementById("playbox").click();
                }
                // 其它浏览器
                else {
                    var e = document.createEvent("MouseEvents");
                    e.initEvent("click", true, true);
                    document.getElementById("playbox").dispatchEvent(e);
                }
            }, 2000);
            */
        });

    </script>
    <span id="playbox" class="btn_music" onclick="playbox.init(this).play();">
        <audio id="audio" loop src="{$config.bgmusic}"></audio>
    </span>
    <div class="banner">
        <div id="wrapper">
            <div id="scroller">
                <ul id="thelist">
                      <vt:function var="hdp" method="getHdp" type="$this" rows="6" />
                <vt:foreach from="$hdp" item="p" index="i">
                      <li>
                        <p>{$p.title}</p>
                        <a href="javascript:void(0)">
                            <img src="{$p.img_url}" /></a></li>

                     </vt:foreach>
                  
                    
                </ul>
            </div>
        </div>
        <div id="nav">
            <div id="prev" onclick="myScroll.scrollToPage('prev', 0,400,2);return false">&larr; prev</div>
            <ul id="indicator">
                   <vt:foreach from="$hdp" item="p" index="i">
                        <vt:if var="#.i.isfirst" value="true">
                            <li class="active"></li>
                            <vt:else>
                                   <li></li>
                           </vt:if>
                  </vt:foreach>

 
            </ul>
            <div id="next" onclick="myScroll.scrollToPage('next', 0);return false">next &rarr;</div>
        </div>
        <div class="clr"></div>
    </div>
    <div id="insert1"></div>
    <ul class="mainmenu">
          <vt:function var="category" method="getCategory" type="$this" classlayer="1" />
        <vt:foreach from="$category" item="c" index="i">
             <li><a href="{$c.link_url}">
            <p><span>{$c.title}</span><i>{$c.content}</i></p>
            <b></b></a></li>

            </vt:foreach>

       
      

    </ul>

    <script>


        var count = document.getElementById("thelist").getElementsByTagName("img").length;
        var count2 = document.getElementsByClassName("menuimg").length;


        for (i = 0; i < count; i++) {
            document.getElementById("thelist").getElementsByTagName("img").item(i).style.cssText = " width:" + document.body.clientWidth + "px";

        }
        for (i = 0; i < count2; i++) {

            document.getElementsByClassName("menuimg").item(i).style.cssText = " HEIGHT:" + (document.body.clientWidth / 320) * 111 + "px";
            document.getElementsByClassName("menumesg").item(i).style.cssText = " HEIGHT:" + (document.body.clientWidth / 320) * 111 + "px";

        }

        document.getElementById("scroller").style.cssText = " width:" + document.body.clientWidth * count + "px";


        setInterval(function () {
            myScroll.scrollToPage('next', 0, 400, count);
        }, 3500);

        window.onresize = function () {
            for (i = 0; i < count; i++) {
                document.getElementById("thelist").getElementsByTagName("img").item(i).style.cssText = " width:" + document.body.clientWidth + "px";

            }
            for (i = 0; i < count2; i++) {


                document.getElementsByClassName("menuimg").item(i).style.cssText = " HEIGHT:" + (document.body.clientWidth / 320) * 111 + "px";
                document.getElementsByClassName("menumesg").item(i).style.cssText = " HEIGHT:" + (document.body.clientWidth / 320) * 111 + "px";

            }

            document.getElementById("scroller").style.cssText = " width:" + document.body.clientWidth * count + "px";
        }

    </script>

    <div class="copyright">{$config.wcopyright}
    </div>
    <div style="display: none">©上海沐雪网络科技提供</div>
    
    <script>
        function displayit(n) {
            for (i = 0; i < 4; i++) {
                if (i == n) {
                    var id = 'menu_list' + n;
                    if (document.getElementById(id).style.display == 'none') {
                        document.getElementById(id).style.display = '';
                        document.getElementById("plug-wrap").style.display = '';
                    } else {
                        document.getElementById(id).style.display = 'none';
                        document.getElementById("plug-wrap").style.display = 'none';
                    }
                } else {
                    if ($('#menu_list' + i)) {
                        $('#menu_list' + i).css('display', 'none');
                    }
                }
            }
        }
        function closeall() {
            var count = document.getElementById("top_menu").getElementsByTagName("ul").length;
            for (i = 0; i < count; i++) {
                document.getElementById("top_menu").getElementsByTagName("ul").item(i).style.display = 'none';
            }
            document.getElementById("plug-wrap").style.display = 'none';
        }

        document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
            WeixinJSBridge.call('hideToolbar');
        });
    </script>
    <!-- share -->

     

    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
       <!--_share_js-->
        <vt:template id="share_js" file="../../csmall/_share_js_index.html" charset="utf-8" />
        <!--/_share_js-->
        <!--_bottommenu-->
        <vt:template id="bottommenu" file="../../bmenu/bottom.html" charset="utf-8" />
        <!--/_bottommenu-->
     
</body>
</html>
